<?php
function get_html($url){
	$c=curl_init();
	curl_setopt($c,CURLOPT_URL,$url);
	curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
	$content=curl_exec($c);
	curl_close($c);
	return $content;
}
define('SEARCH_ALL',1000);
define('SEARCH_TAOBAO',1001);
define('SEARCH_PAIPAI',1002);
define('SEARCH_YIQU',1003);
define('SEARCH_ZHUOYUE',1004);
define('SEARCH_JINGDONG',1005);
$type=empty($_GET['stype'])?0:intval($_GET['stype']);
$keyword=empty($_GET['skeyword'])?'':urldecode($_GET['skeyword']);
$detail=empty($_POST['detail'])?'':$_POST['detail'];
$data['page']['title']='ShoppingBox';
if ($type){
	switch ($type){
		case SEARCH_ALL:
			include 'shoopingbox/taobao.php';
			break;
		case SEARCH_TAOBAO:
			include 'shoopingbox/taobao.php';
			break;
		case SEARCH_PAIPAI:
			include 'shoopingbox/paipai.php';
			break;
		case SEARCH_YIQU:
			include 'shoopingbox/yiqu.php';
			break;
		case SEARCH_ZHUOYUE:
			include 'shoopingbox/zhuoyue.php';
			break;
		case SEARCH_JINGDONG:
			include 'shoopingbox/jingdong.php';
			break;
		default:
			include 'shoopingbox/all.php';
			break;
	}
}elseif ($detail){
	$type=empty($_POST['type'])?1000:intval($_POST['type']);
	switch ($type){
		case SEARCH_TAOBAO:
			include 'shoopingbox/taobao_detail.php';
			break;
		case SEARCH_PAIPAI:
			include 'shoopingbox/paipai_detail.php';
			break;
		case SEARCH_YIQU:
			include 'shoopingbox/yiqu_detail.php';
			break;
		case SEARCH_ZHUOYUE:
			include 'shoopingbox/zhuoyue_detail.php';
			break;
		case SEARCH_JINGDONG:
			include 'shoopingbox/jingdong_detail.php';
			break;
	}
}
?>